<?php
/**
 * RadomStr.php
 * Author: luoji (867404364@qq.com)
 * Date: 2020-12-18
 * Time: 16:22
 */

namespace App\Tool;


abstract class RandomStr
{
    const list = [
      1,2,3,4,5,6,7,8,9,0,
      'a','b','c','d','e','f','g','h','i','j','k','l','m','n',
      'o','p','q','r','s','t','u','v','w','x','y','z'
    ];

    public static function make($len = 4)
    {
        $keys = array_rand(self::list, $len);
        $r = '';
        foreach($keys as $v) {
            $r .= self::list[$v];
        }
        return $r;
    }
}